package com.xiaoma.controller;


import com.xiaoma.pojo.Result;
import com.xiaoma.pojo.Software;
import com.xiaoma.service.SoftwareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/api")
public class SoftwareController {
    @Autowired
    private SoftwareService softwareService;

    @GetMapping("software")
    public Result<List<Software>> getSoftware(){
        List<Software> software = softwareService.getSoftware();
        return Result.success(software);
    }

}
